﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using E_Commerce.Domain.Interfaces;
using Dapper;
using Microsoft.Extensions.Configuration;
using E_Commerce.Domain.Entities;

/// <summary>
/// 实现类
/// </summary>
namespace E_Commerce.Infrastructure.Data
{
    public class UserRepository:DapperRepository<Users>,IUserRepository
    {
        //依赖注入
        public IConfiguration _configuration;

        public UserRepository(IConfiguration configuration)
        {
           this._configuration = configuration;
            //连接字符串
            this.ConnStr = _configuration.GetConnectionString("ConnStr");
            SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);
            Conn = new MySql.Data.MySqlClient.MySqlConnection(this.ConnStr);
        }

        //重写基类的方法(多表联查)
        //public override IEnumerable<Class1> GetList(string whereCondition = "", object paras = null)
        //{

        //    return base.GetList(whereCondition, paras);
        //}
    }
}
